import { prisma } from '../../utils/prisma'
import { getUserIdOrThrow } from '../../utils/guard'

export default eventHandler(async (event) => {
  const userId = getUserIdOrThrow(event)
  const children = await prisma.child.findMany({ where: { userId }, orderBy: { id: 'asc' } })
  return { children }
})


